import mongoose, { ConnectOptions } from "mongoose";
import { config } from "../config";
const dbconnect = async () => {
  try {
    await mongoose.connect(config.db_url, {
      useNewUrlParser: true,
    } as ConnectOptions);
    console.log("数据库连接成功");
  } catch (err) {
    console.log(`数据库连接失败`);
    console.log(err);
  }
};
export { dbconnect };
